The Internet is moving from Internet protocol (IP) version 4 (IPv4) to IP version 6 (IPv6). Some networks can support IPv4 only; some networks can support both IPv4 and IPv6 address families; and some networks support IPv6 only. Devices such as mobile phones can support multiple network interfaces such as cellular and WiFi. Some of those network interfaces may have different address families (IPv4/IPv6) available. Some devices prefer WiFi to cellular for power and cost reasons.
In a conventional implementation of a network stack that supports both IPv4 and IPv6 address families and multiple network interfaces where one interface may be preferred over another, mixing address families presents a challenge. Most applications attempt to connect to a host by hostname and port. That hostname is resolved using domain name service (DNS) to both IPv4 and IPv6 addresses. Most network stacks designate a default gateway for each address family (IPv6 and IPv4). In some cases, the preferred interface may be WiFi but WiFi only supports IPv4 while cellular supports both IPv4 and IPv6. When this happens, some systems may set a default route for IPv4 to go out via WiFi and the default route for IPv6 to go out via cellular. A conventional implementation will not take this routing into account when sorting address returned from DNS.